from django.core.management.base import BaseCommand
from apps.oaauth.models import OADepartment

# 运行命令如：python manage.py initdepartments
class Command(BaseCommand):
    def handle(self, *args, **options):
    # 初始化部门数据
        boarder = OADepartment.objects.create(name="董事会", intro="董事会")
        developer = OADepartment.objects.create(name="产品开发部", intro="产品设计技术开发")
        sales = OADepartment.objects.create(name="销售部", intro="销售部是公司销售部门")
        operation = OADepartment.objects.create(name="运营部", intro="产品运营")
        hr = OADepartment.objects.create(name="人事部", intro="人事部是公司人事部门")
        finance = OADepartment.objects.create(name="财务部", intro="财务报表")
        self.stdout.write(self.style.SUCCESS('部门数据初始化成功！'))



